{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "from sklearn.metrics import mean_squared_error\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instant</th>\n",
       "      <th>season_1</th>\n",
       "      <th>season_2</th>\n",
       "      <th>season_3</th>\n",
       "      <th>season_4</th>\n",
       "      <th>mnth_1</th>\n",
       "      <th>mnth_2</th>\n",
       "      <th>mnth_3</th>\n",
       "      <th>mnth_4</th>\n",
       "      <th>mnth_5</th>\n",
       "      <th>...</th>\n",
       "      <th>weekday_5</th>\n",
       "      <th>weekday_6</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>holiday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>yr</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.355170</td>\n",
       "      <td>0.373517</td>\n",
       "      <td>0.828620</td>\n",
       "      <td>0.284606</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>985</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.379232</td>\n",
       "      <td>0.360541</td>\n",
       "      <td>0.715771</td>\n",
       "      <td>0.466215</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.171000</td>\n",
       "      <td>0.144830</td>\n",
       "      <td>0.449638</td>\n",
       "      <td>0.465740</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1349</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.175530</td>\n",
       "      <td>0.174649</td>\n",
       "      <td>0.607131</td>\n",
       "      <td>0.284297</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.209120</td>\n",
       "      <td>0.197158</td>\n",
       "      <td>0.449313</td>\n",
       "      <td>0.339143</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 35 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   instant  season_1  season_2  season_3  season_4  mnth_1  mnth_2  mnth_3  \\\n",
       "0        1         1         0         0         0       1       0       0   \n",
       "1        2         1         0         0         0       1       0       0   \n",
       "2        3         1         0         0         0       1       0       0   \n",
       "3        4         1         0         0         0       1       0       0   \n",
       "4        5         1         0         0         0       1       0       0   \n",
       "\n",
       "   mnth_4  mnth_5  ...   weekday_5  weekday_6      temp     atemp       hum  \\\n",
       "0       0       0  ...           0          1  0.355170  0.373517  0.828620   \n",
       "1       0       0  ...           0          0  0.379232  0.360541  0.715771   \n",
       "2       0       0  ...           0          0  0.171000  0.144830  0.449638   \n",
       "3       0       0  ...           0          0  0.175530  0.174649  0.607131   \n",
       "4       0       0  ...           0          0  0.209120  0.197158  0.449313   \n",
       "\n",
       "   windspeed  holiday  workingday  yr   cnt  \n",
       "0   0.284606        0           0   0   985  \n",
       "1   0.466215        0           0   0   801  \n",
       "2   0.465740        0           1   0  1349  \n",
       "3   0.284297        0           1   0  1562  \n",
       "4   0.339143        0           1   0  1600  \n",
       "\n",
       "[5 rows x 35 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_csv(\"FE_day.csv\")\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 731 entries, 0 to 730\n",
      "Data columns (total 35 columns):\n",
      "instant         731 non-null int64\n",
      "season_1        731 non-null int64\n",
      "season_2        731 non-null int64\n",
      "season_3        731 non-null int64\n",
      "season_4        731 non-null int64\n",
      "mnth_1          731 non-null int64\n",
      "mnth_2          731 non-null int64\n",
      "mnth_3          731 non-null int64\n",
      "mnth_4          731 non-null int64\n",
      "mnth_5          731 non-null int64\n",
      "mnth_6          731 non-null int64\n",
      "mnth_7          731 non-null int64\n",
      "mnth_8          731 non-null int64\n",
      "mnth_9          731 non-null int64\n",
      "mnth_10         731 non-null int64\n",
      "mnth_11         731 non-null int64\n",
      "mnth_12         731 non-null int64\n",
      "weathersit_1    731 non-null int64\n",
      "weathersit_2    731 non-null int64\n",
      "weathersit_3    731 non-null int64\n",
      "weekday_0       731 non-null int64\n",
      "weekday_1       731 non-null int64\n",
      "weekday_2       731 non-null int64\n",
      "weekday_3       731 non-null int64\n",
      "weekday_4       731 non-null int64\n",
      "weekday_5       731 non-null int64\n",
      "weekday_6       731 non-null int64\n",
      "temp            731 non-null float64\n",
      "atemp           731 non-null float64\n",
      "hum             731 non-null float64\n",
      "windspeed       731 non-null float64\n",
      "holiday         731 non-null int64\n",
      "workingday      731 non-null int64\n",
      "yr              731 non-null int64\n",
      "cnt             731 non-null int64\n",
      "dtypes: float64(4), int64(31)\n",
      "memory usage: 200.0 KB\n"
     ]
    }
   ],
   "source": [
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = data[\"cnt\"]\n",
    "X = data.drop([\"instant\", \"cnt\"], axis = 1)\n",
    "feat_names = X.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(584, 33)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state = 33, test_size = 0.2)\n",
    "X_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler\n",
    "ss_X = StandardScaler()\n",
    "ss_y = StandardScaler()\n",
    "\n",
    "X_train = ss_X.fit_transform(X_train)\n",
    "X_test = ss_X.transform(X_test)\n",
    "\n",
    "y_train = pd.DataFrame(y_train)\n",
    "y_test = pd.DataFrame(y_test)\n",
    "\n",
    "y_train = ss_y.fit_transform(y_train)\n",
    "y_test = ss_y.transform(y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>coef</th>\n",
       "      <th>columns</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>[11474802741074.229]</td>\n",
       "      <td>weekday_6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>[11133753278312.238]</td>\n",
       "      <td>weekday_0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>[7536902263526.668]</td>\n",
       "      <td>weekday_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>[7263909066684.871]</td>\n",
       "      <td>weekday_5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>[7228285675356.838]</td>\n",
       "      <td>weekday_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>[7044819948074.732]</td>\n",
       "      <td>weekday_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>[6968832167683.969]</td>\n",
       "      <td>weekday_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>[5449395354176.892]</td>\n",
       "      <td>workingday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>[1864053055931.0798]</td>\n",
       "      <td>holiday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>[0.5230867008368583]</td>\n",
       "      <td>yr</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>[0.2829303773799931]</td>\n",
       "      <td>temp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>[0.13712211585161668]</td>\n",
       "      <td>atemp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>[-0.10110842672596665]</td>\n",
       "      <td>windspeed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>[-0.10122042665236539]</td>\n",
       "      <td>hum</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>[-113429108.14347842]</td>\n",
       "      <td>season_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[-115354305.10799249]</td>\n",
       "      <td>season_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>[-116142627.77397144]</td>\n",
       "      <td>season_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>[-117409137.08857714]</td>\n",
       "      <td>season_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>[-617838261453.4089]</td>\n",
       "      <td>weathersit_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>[-1789489836641.3328]</td>\n",
       "      <td>weathersit_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>[-1821870052678.0684]</td>\n",
       "      <td>weathersit_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>[-11324513398298.457]</td>\n",
       "      <td>mnth_6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>[-11444844800810.082]</td>\n",
       "      <td>mnth_10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>[-11680373848486.35]</td>\n",
       "      <td>mnth_9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>[-11909395091699.064]</td>\n",
       "      <td>mnth_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>[-11909395091699.07]</td>\n",
       "      <td>mnth_7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>[-11909395091699.123]</td>\n",
       "      <td>mnth_11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>[-12021581930493.863]</td>\n",
       "      <td>mnth_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>[-12132277079920.521]</td>\n",
       "      <td>mnth_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>[-12132277079920.635]</td>\n",
       "      <td>mnth_12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>[-12241521006286.586]</td>\n",
       "      <td>mnth_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>[-12455807419318.012]</td>\n",
       "      <td>mnth_5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>[-12560921581776.17]</td>\n",
       "      <td>mnth_8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      coef       columns\n",
       "25    [11474802741074.229]     weekday_6\n",
       "19    [11133753278312.238]     weekday_0\n",
       "22     [7536902263526.668]     weekday_3\n",
       "24     [7263909066684.871]     weekday_5\n",
       "21     [7228285675356.838]     weekday_2\n",
       "20     [7044819948074.732]     weekday_1\n",
       "23     [6968832167683.969]     weekday_4\n",
       "31     [5449395354176.892]    workingday\n",
       "30    [1864053055931.0798]       holiday\n",
       "32    [0.5230867008368583]            yr\n",
       "26    [0.2829303773799931]          temp\n",
       "27   [0.13712211585161668]         atemp\n",
       "29  [-0.10110842672596665]     windspeed\n",
       "28  [-0.10122042665236539]           hum\n",
       "3    [-113429108.14347842]      season_4\n",
       "0    [-115354305.10799249]      season_1\n",
       "1    [-116142627.77397144]      season_2\n",
       "2    [-117409137.08857714]      season_3\n",
       "18    [-617838261453.4089]  weathersit_3\n",
       "17   [-1789489836641.3328]  weathersit_2\n",
       "16   [-1821870052678.0684]  weathersit_1\n",
       "9    [-11324513398298.457]        mnth_6\n",
       "13   [-11444844800810.082]       mnth_10\n",
       "12    [-11680373848486.35]        mnth_9\n",
       "5    [-11909395091699.064]        mnth_2\n",
       "10    [-11909395091699.07]        mnth_7\n",
       "14   [-11909395091699.123]       mnth_11\n",
       "4    [-12021581930493.863]        mnth_1\n",
       "7    [-12132277079920.521]        mnth_4\n",
       "15   [-12132277079920.635]       mnth_12\n",
       "6    [-12241521006286.586]        mnth_3\n",
       "8    [-12455807419318.012]        mnth_5\n",
       "11    [-12560921581776.17]        mnth_8"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LinearRegression\n",
    "lr = LinearRegression()\n",
    "lr.fit(X_train, y_train)\n",
    "y_test_pred_lr = lr.predict(X_test)\n",
    "y_train_pred_lr = lr.predict(X_train)\n",
    "fs = pd.DataFrame({\"columns\": list(feat_names), \"coef\": list((lr.coef_.T))})\n",
    "fs.sort_values(by = ['coef'], ascending = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The RMSE of LinearRegression on test is 0.42264633971709975\n",
      "The RMSE of LinearRegression on train is 0.38840719435157744\n"
     ]
    }
   ],
   "source": [
    "print \"The RMSE of LinearRegression on test is\", np.sqrt(mean_squared_error(y_test, y_test_pred_lr))\n",
    "print \"The RMSE of LinearRegression on train is\", np.sqrt(mean_squared_error(y_train, y_train_pred_lr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAAFsCAYAAADos0H8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAHF5JREFUeJzt3X+YlWW97/H3V5ygLYqhoAg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MaUmSCtWr56QlSR174YUXWL16Nc895xVK+4shQ4YwZswYWlpaur0PQ1qSCrB69Wr23ntvxo0bR0Sj/vmZ+kpmsnHjRlavXs348eO7vR+HuyWpAM899xz77befAd1PRAT77bdfj0dGDGlJKoQB3b804v00pCVJKpTnpCWpQHPm9P7+Bg0axNFHH83mzZsZP3483/3ud9l33313+VgXXnghH/rQhzjiiCO2WX/NNdewZMkSvva1r+3yPgGGDh3Kpk2b6tp26tSpXHHFFbS2tm5dt2TJEq699lquvPLKbh2/L9iTliQB8NKXvpRly5bxwAMPMHz4cK666qpu7efqq6/eIaBL0Nra2vSA3rJlS0P3Z0hLknYwZcoU1qxZs3X58ssv57jjjuOYY47hM5/5DADPPPMM06dPZ8KECRx11FHMnz8fqPVi2y4B/Z3vfIfDDjuMN7zhDdx1111b93f++edz8803b10eOnQoAJs2bWLatGkce+yxHH300SxYsGCH2tauXctJJ53ExIkTOeqoo/jpT39a12tatGgRp59+OgBz5szhggsuYOrUqRx88MHbhPd1113H5MmTmThxIu95z3u2Bu/FF19Ma2srRx555NY2gNolry+77DJe//rXc9NNN9VVS70c7pYkbWPLli0sXLiQWbNmAXDbbbexYsUK7rnnHjKTM844g8WLF7NhwwYOOuggfvSjHwHw5JNPbrOftWvX8pnPfIalS5cybNgwTj75ZCZNmrTTYw8ZMoRbbrmFffbZh8cff5zjjz+eM844Y5tJWN/73vc49dRT+eQnP8mWLVv485//3K3X+fDDD3PHHXfw9NNP86pXvYqLL76YlStXMn/+fO666y5aWlp43/vex/XXX895553H5z//eYYPH86WLVuYNm0a9913H8ccc8zWuu+8885u1bEzhrQkCYBnn32WiRMn8uijj/Ka17yGN7/5zUAtpG+77batAbtp0yZWrFjBiSeeyIc//GE+9rGPcfrpp3PiiSdus7+7776bqVOnMmJE7R8+nXXWWfzmN7/ZaQ2ZySc+8QkWL17MHnvswZo1a1i3bh0HHnjg1m2OO+44LrjgAl544QXOPPNMJk6c2K3XO336dAYPHszgwYMZOXIk69atY+HChSxd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I1eqKm3XcPO2wDgp+0+A5c1uyBDGsjM5Zm5O1wJrWnqbIP+finYGcC86v484Mw+rKU31fO+tm+bm4FpEdHRBY12V/39s92lzFwM/HEnm8wArs2anwP7RsSo3qmud9TRBr3OkN41CdwWEUury50ONKOB37dbXl2t6y8OyMy1ANXtyE62GxIRSyLi5xHRH4K8nvd16zaZuRl4EtivV6rrHfV+tv+uGuq9OSJe3sHj/Vl///6v15SI+FVE/Dgijmz2wXpyWdDdSkT8X+DADh76ZGYuqHM3J2TmYxExErg9Ih6ufvPaLTSgDeq6FGzJdtYGu7CbsdXn4GDgJxFxf2b+tjEV9ol63tfd/r3vQj2v71+B72fmXyLivdRGFt7Y9MrK0d8/A/W4l9p1tzdFxFuBH1Ab/m+aARPSmfmmBuzjsep2fUTcQm2IbLcJ6Qa0wW5/KdidtUFErIuIUZm5thrGW9/JPto+B49ExCJgErA7h3Q972vbNqsjYk9gGIUNC/ZQl22QmRvbLf4z/ey8fB12++//nsrMp9rd/7eI+HpE7J+ZTfvnIw531yki9oqIvdvuA6dQm2w1kPT3S8HeCsys7s8EdhhdiIiXRcTg6v7+wAnAQ71WYXPU8762b5u3Az/J/nUlpC7bYLvzr2cAy3uxvhLcCpxXzfI+Hniy7fTQQBERB7bNxYiIydQydOPOn9VDmTngv4C/pfZb4l+AdcC/V+sPAv6tun8w8Kvq60FqQ8R9XntvtkG1/FbgN9R6jv2tDfajNqt7RXU7vFrfClxd3X8dcH/1ObgfmNXXdTfote/wvgKXAWdU94cANwErgXuAg/u65j5ogy9U3/u/Au4AXt3XNTf49X8fWAu8UP0smAW8F3hv9XhQmwH/2+qz39rXNfdBG3yg3Wfg58Drml2TlwWVJKlQDndLklQoQ1qSpEIZ0pIkFcqQliSpUIa0JEmFMqQlSSqUIS1JUqH+P6S+nbuT/hp2AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 504x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "f, ax = plt.subplots(figsize=(7, 5)) \n",
    "f.tight_layout() \n",
    "ax.hist(y_train - y_train_pred_lr, bins=40, label='Residuals Linear', color='b', alpha=.5); \n",
    "ax.set_title(\"Histogram of Residuals\") \n",
    "ax.legend(loc='best');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAADQCAYAAADcQn7hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xl8lPX16PHPyWTIBiEgUSBCcUEqAoKCqLEWrRW8KKJWcaG1RcX+rtpauf7EalVavWJRS6utrRWVS2kLrUoLSFXEpfoTlZ1atBUsS9wIJEAgkMnMuX/MDA7JLM9klmcyOe/XKy8yk8nzHELm8F3PV1QVY4zJhAK3AzDG5C9LMMaYjLEEY4zJGEswxpiMsQRjjMkYSzDGmIyxBGOMyRhLMMaYjLEEY4zJmEK3A0hGjx49tF+/fm6HYUyHt3LlylpVrUz0unaVYPr168eKFSvcDsOYDk9ENjt5nXWRjDEZYwnGGJMxriUYESkWkXdEZK2IvCci09yKxRiTGW6OwRwAzlbVBhHxAm+IyBJVXe5iTMaYNHKtBaNBDaGH3tCHFacxxgWNjY2sWbMm7dd1dQxGRDwisgb4HHhJVd+O8prJIrJCRFZs3749+0Eak+dWr17N8OHDOffcc2loaEj8DUlwNcGoql9VhwJHAqeIyKAor3lcVYer6vDKyoTT7sYYh/x+P9OnT2fkyJHU1dUxZ84cOnfunNZ75MQskqrWA68CY1wOxZgO48Ybb+T2229n/PjxrF+/ntGjR6f9Hq4N8opIJeBT1XoRKQHOAR5wKx5jOgJVpampiaKiIm666Saqq6u56qqrEJGM3M/NWaRewGwR8RBsS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n0swZhMGwjMUtVhQLyV1L8AfqrBM3kuA57IRnAms2wMxmTaRlV918HrzgEGBHtSAHQTkRJVbcxcaCbTLMGYTNsb8XmAQ8s2FEd8LtiAcN6xLpLJmtAAb52I9BeRAuCiiC8vBW4IPxCRodmOz6SfJRiTbbcBfyM4rb0t4vkbgOpQcfR/Ate5EZxJL5umNsZkjLVgjDEZYwnGGJMxlmCMMRljCcYYkzGWYIwxGWMJxhiTMZZgjDEZ8/8BC0kowq0KPQcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 288x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(4, 3))\n",
    "plt.scatter(y_train, y_train_pred_lr)\n",
    "plt.plot([-3, 3], [-3, 3], '--k')   \n",
    "plt.axis('tight')\n",
    "plt.xlabel('True')\n",
    "plt.ylabel('Predicted')\n",
    "plt.tight_layout()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The RMSE of RidgeCV on test is 0.42264633971709975\n",
      "The RMSE of RidgeCV on train is 0.38840719435157744\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import RidgeCV\n",
    "alphas = [0.01, 0.1, 1, 10, 100]\n",
    "ridge = RidgeCV(alphas = alphas, store_cv_values = True)\n",
    "ridge.fit(X_train, y_train)\n",
    "y_test_pred_ridge = ridge.predict(X_test)\n",
    "y_train_pred_ridge = ridge.predict(X_train)\n",
    "print \"The RMSE of RidgeCV on test is\", np.sqrt(mean_squared_error(y_test, y_test_pred_lr))\n",
    "print \"The RMSE of RidgeCV on train is\", np.sqrt(mean_squared_error(y_train, y_train_pred_lr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEKCAYAAAA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TpRIhERkTpRIhERkTpRIhERkTpRIhERkTpRIhERkTr5/zk6sOoS9E37AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('alpha is:', 10.0)\n"
     ]
    }
   ],
   "source": [
    "mse_mean = np.mean(ridge.cv_values_, axis = 0)\n",
    "plt.plot(np.log10(alphas), mse_mean.reshape(len(alphas),1)) \n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()\n",
    "print ('alpha is:', ridge.alpha_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>coef_lr</th>\n",
       "      <th>coef_ridge</th>\n",
       "      <th>columns</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>[11474802741074.229]</td>\n",
       "      <td>[0.027486736806675682]</td>\n",
       "      <td>weekday_6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>[11133753278312.238]</td>\n",
       "      <td>[-0.04796315723174788]</td>\n",
       "      <td>weekday_0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>[7536902263526.668]</td>\n",
       "      <td>[0.01691573212198294]</td>\n",
       "      <td>weekday_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>[7263909066684.871]</td>\n",
       "      <td>[0.019019838920564913]</td>\n",
       "      <td>weekday_5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>[7228285675356.838]</td>\n",
       "      <td>[-0.0010661803717622875]</td>\n",
       "      <td>weekday_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>[7044819948074.732]</td>\n",
       "      <td>[-0.03086982808936989]</td>\n",
       "      <td>weekday_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>[6968832167683.969]</td>\n",
       "      <td>[0.014146471577980768]</td>\n",
       "      <td>weekday_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>[5449395354176.892]</td>\n",
       "      <td>[0.025077860369156046]</td>\n",
       "      <td>workingday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>[1864053055931.0798]</td>\n",
       "      <td>[-0.03063756616741456]</td>\n",
       "      <td>holiday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>[0.5230867008368583]</td>\n",
       "      <td>[0.5152241992682746]</td>\n",
       "      <td>yr</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>[0.2829303773799931]</td>\n",
       "      <td>[0.22965247965367977]</td>\n",
       "      <td>temp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>[0.13712211585161668]</td>\n",
       "      <td>[0.17918643598208345]</td>\n",
       "      <td>atemp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>[-0.10110842672596665]</td>\n",
       "      <td>[-0.0962071504909085]</td>\n",
       "      <td>windspeed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>[-0.10122042665236539]</td>\n",
       "      <td>[-0.1015905661876797]</td>\n",
       "      <td>hum</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>[-113429108.14347842]</td>\n",
       "      <td>[0.17006202649589203]</td>\n",
       "      <td>season_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[-115354305.10799249]</td>\n",
       "      <td>[-0.16915166376321578]</td>\n",
       "      <td>season_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>[-116142627.77397144]</td>\n",
       "      <td>[0.025475716902625622]</td>\n",
       "      <td>season_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>[-117409137.08857714]</td>\n",
       "      <td>[-0.023306773177331236]</td>\n",
       "      <td>season_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>[-617838261453.4089]</td>\n",
       "      <td>[-0.15713515483271046]</td>\n",
       "      <td>weathersit_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>[-1789489836641.3328]</td>\n",
       "      <td>[-0.03494540718077488]</td>\n",
       "      <td>weathersit_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>[-1821870052678.0684]</td>\n",
       "      <td>[0.08761248456094617]</td>\n",
       "      <td>weathersit_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>[-11324513398298.457]</td>\n",
       "      <td>[0.04172045343050712]</td>\n",
       "      <td>mnth_6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>[-11444844800810.082]</td>\n",
       "      <td>[0.03428473952949118]</td>\n",
       "      <td>mnth_10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>[-11680373848486.35]</td>\n",
       "      <td>[0.10918985463794262]</td>\n",
       "      <td>mnth_9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>[-11909395091699.064]</td>\n",
       "      <td>[-0.04428011277629945]</td>\n",
       "      <td>mnth_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>[-11909395091699.07]</td>\n",
       "      <td>[-0.03919088792124781]</td>\n",
       "      <td>mnth_7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>[-11909395091699.123]</td>\n",
       "      <td>[-0.0708794782262453]</td>\n",
       "      <td>mnth_11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>[-12021581930493.863]</td>\n",
       "      <td>[-0.05609126948370452]</td>\n",
       "      <td>mnth_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>[-12132277079920.521]</td>\n",
       "      <td>[0.002098490287302815]</td>\n",
       "      <td>mnth_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>[-12132277079920.635]</td>\n",
       "      <td>[-0.07983496498832676]</td>\n",
       "      <td>mnth_12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>[-12241521006286.586]</td>\n",
       "      <td>[0.023625814571778925]</td>\n",
       "      <td>mnth_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>[-12455807419318.012]</td>\n",
       "      <td>[0.04695212337984417]</td>\n",
       "      <td>mnth_5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>[-12560921581776.17]</td>\n",
       "      <td>[0.0351390527865387]</td>\n",
       "      <td>mnth_8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   coef_lr                coef_ridge       columns\n",
       "25    [11474802741074.229]    [0.027486736806675682]     weekday_6\n",
       "19    [11133753278312.238]    [-0.04796315723174788]     weekday_0\n",
       "22     [7536902263526.668]     [0.01691573212198294]     weekday_3\n",
       "24     [7263909066684.871]    [0.019019838920564913]     weekday_5\n",
       "21     [7228285675356.838]  [-0.0010661803717622875]     weekday_2\n",
       "20     [7044819948074.732]    [-0.03086982808936989]     weekday_1\n",
       "23     [6968832167683.969]    [0.014146471577980768]     weekday_4\n",
       "31     [5449395354176.892]    [0.025077860369156046]    workingday\n",
       "30    [1864053055931.0798]    [-0.03063756616741456]       holiday\n",
       "32    [0.5230867008368583]      [0.5152241992682746]            yr\n",
       "26    [0.2829303773799931]     [0.22965247965367977]          temp\n",
       "27   [0.13712211585161668]     [0.17918643598208345]         atemp\n",
       "29  [-0.10110842672596665]     [-0.0962071504909085]     windspeed\n",
       "28  [-0.10122042665236539]     [-0.1015905661876797]           hum\n",
       "3    [-113429108.14347842]     [0.17006202649589203]      season_4\n",
       "0    [-115354305.10799249]    [-0.16915166376321578]      season_1\n",
       "1    [-116142627.77397144]    [0.025475716902625622]      season_2\n",
       "2    [-117409137.08857714]   [-0.023306773177331236]      season_3\n",
       "18    [-617838261453.4089]    [-0.15713515483271046]  weathersit_3\n",
       "17   [-1789489836641.3328]    [-0.03494540718077488]  weathersit_2\n",
       "16   [-1821870052678.0684]     [0.08761248456094617]  weathersit_1\n",
       "9    [-11324513398298.457]     [0.04172045343050712]        mnth_6\n",
       "13   [-11444844800810.082]     [0.03428473952949118]       mnth_10\n",
       "12    [-11680373848486.35]     [0.10918985463794262]        mnth_9\n",
       "5    [-11909395091699.064]    [-0.04428011277629945]        mnth_2\n",
       "10    [-11909395091699.07]    [-0.03919088792124781]        mnth_7\n",
       "14   [-11909395091699.123]     [-0.0708794782262453]       mnth_11\n",
       "4    [-12021581930493.863]    [-0.05609126948370452]        mnth_1\n",
       "7    [-12132277079920.521]    [0.002098490287302815]        mnth_4\n",
       "15   [-12132277079920.635]    [-0.07983496498832676]       mnth_12\n",
       "6    [-12241521006286.586]    [0.023625814571778925]        mnth_3\n",
       "8    [-12455807419318.012]     [0.04695212337984417]        mnth_5\n",
       "11    [-12560921581776.17]      [0.0351390527865387]        mnth_8"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fs = pd.DataFrame({\"columns\":list(feat_names), \"coef_lr\":list((lr.coef_.T)), \"coef_ridge\":list((ridge.coef_.T))})\n",
    "fs.sort_values(by=['coef_lr'],ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The RMSE of LassoCV on test is 0.42264633971709975\n",
      "The RMSE of LassoCV on train is 0.38840719435157744\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/wangdong/anaconda2/lib/python2.7/site-packages/sklearn/linear_model/coordinate_descent.py:1094: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n",
      "  y = column_or_1d(y, warn=True)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LassoCV\n",
    "lasso = LassoCV()\n",
    "lasso.fit(X_train, y_train)\n",
    "y_test_pred_lasso = lasso.predict(X_test)\n",
    "y_train_pred_lasso = lasso.predict(X_train)\n",
    "print \"The RMSE of LassoCV on test is\", np.sqrt(mean_squared_error(y_test, y_test_pred_lr))\n",
    "print \"The RMSE of LassoCV on train is\", np.sqrt(mean_squared_error(y_train, y_train_pred_lr))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIu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+zceCGkRCpbukiiQwsyHufsTMRhHfe7g0CIxBxL+oLw36IlJZ1xF3H9JDdb0K3ODxMb9FQqM9BZETPWNmw4Fc4Nvu/j6Aux8zs/uJjx+8szcLCg5x/aMCQXqD9hRERKSdOppFRKSdQkFERNopFEREpJ1CQURE2ikURESknUJBRETa/X+ge2VwrX7poAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('alpha is:', 0.008792876953716259)\n"
     ]
    }
   ],
   "source": [
    "mses = np.mean(lasso.mse_path_, axis = 1)\n",
    "plt.plot(np.log10(lasso.alphas_), mses) \n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()               \n",
    "print ('alpha is:', lasso.alpha_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>coef_lasso</th>\n",
       "      <th>coef_lr</th>\n",
       "      <th>coef_ridge</th>\n",
       "      <th>columns</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>[11474802741074.229]</td>\n",
       "      <td>[0.027486736806675682]</td>\n",
       "      <td>weekday_6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>-0.063867</td>\n",
       "      <td>[11133753278312.238]</td>\n",
       "      <td>[-0.04796315723174788]</td>\n",
       "      <td>weekday_0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0.000664</td>\n",
       "      <td>[7536902263526.668]</td>\n",
       "      <td>[0.01691573212198294]</td>\n",
       "      <td>weekday_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>0.004377</td>\n",
       "      <td>[7263909066684.871]</td>\n",
       "      <td>[0.019019838920564913]</td>\n",
       "      <td>weekday_5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>-0.000356</td>\n",
       "      <td>[7228285675356.838]</td>\n",
       "      <td>[-0.0010661803717622875]</td>\n",
       "      <td>weekday_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>-0.030203</td>\n",
       "      <td>[7044819948074.732]</td>\n",
       "      <td>[-0.03086982808936989]</td>\n",
       "      <td>weekday_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>[6968832167683.969]</td>\n",
       "      <td>[0.014146471577980768]</td>\n",
       "      <td>weekday_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>0.000127</td>\n",
       "      <td>[5449395354176.892]</td>\n",
       "      <td>[0.025077860369156046]</td>\n",
       "      <td>workingday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>-0.035459</td>\n",
       "      <td>[1864053055931.0798]</td>\n",
       "      <td>[-0.03063756616741456]</td>\n",
       "      <td>holiday</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>0.515466</td>\n",
       "      <td>[0.5230867008368583]</td>\n",
       "      <td>[0.5152241992682746]</td>\n",
       "      <td>yr</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>0.308551</td>\n",
       "      <td>[0.2829303773799931]</td>\n",
       "      <td>[0.22965247965367977]</td>\n",
       "      <td>temp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>0.123261</td>\n",
       "      <td>[0.13712211585161668]</td>\n",
       "      <td>[0.17918643598208345]</td>\n",
       "      <td>atemp</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>-0.090251</td>\n",
       "      <td>[-0.10110842672596665]</td>\n",
       "      <td>[-0.0962071504909085]</td>\n",
       "      <td>windspeed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>-0.095121</td>\n",
       "      <td>[-0.10122042665236539]</td>\n",
       "      <td>[-0.1015905661876797]</td>\n",
       "      <td>hum</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.112338</td>\n",
       "      <td>[-113429108.14347842]</td>\n",
       "      <td>[0.17006202649589203]</td>\n",
       "      <td>season_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.212750</td>\n",
       "      <td>[-115354305.10799249]</td>\n",
       "      <td>[-0.16915166376321578]</td>\n",
       "      <td>season_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.017570</td>\n",
       "      <td>[-116142627.77397144]</td>\n",
       "      <td>[0.025475716902625622]</td>\n",
       "      <td>season_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.000000</td>\n",
       "      <td>[-117409137.08857714]</td>\n",
       "      <td>[-0.023306773177331236]</td>\n",
       "      <td>season_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>-0.142207</td>\n",
       "      <td>[-617838261453.4089]</td>\n",
       "      <td>[-0.15713515483271046]</td>\n",
       "      <td>weathersit_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>-0.000000</td>\n",
       "      <td>[-1789489836641.3328]</td>\n",
       "      <td>[-0.03494540718077488]</td>\n",
       "      <td>weathersit_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0.118488</td>\n",
       "      <td>[-1821870052678.0684]</td>\n",
       "      <td>[0.08761248456094617]</td>\n",
       "      <td>weathersit_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.018321</td>\n",
       "      <td>[-11324513398298.457]</td>\n",
       "      <td>[0.04172045343050712]</td>\n",
       "      <td>mnth_6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.052847</td>\n",
       "      <td>[-11444844800810.082]</td>\n",
       "      <td>[0.03428473952949118]</td>\n",
       "      <td>mnth_10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0.085700</td>\n",
       "      <td>[-11680373848486.35]</td>\n",
       "      <td>[0.10918985463794262]</td>\n",
       "      <td>mnth_9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>-0.011136</td>\n",
       "      <td>[-11909395091699.064]</td>\n",
       "      <td>[-0.04428011277629945]</td>\n",
       "      <td>mnth_2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>-0.063268</td>\n",
       "      <td>[-11909395091699.07]</td>\n",
       "      <td>[-0.03919088792124781]</td>\n",
       "      <td>mnth_7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>-0.030991</td>\n",
       "      <td>[-11909395091699.123]</td>\n",
       "      <td>[-0.0708794782262453]</td>\n",
       "      <td>mnth_11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.022566</td>\n",
       "      <td>[-12021581930493.863]</td>\n",
       "      <td>[-0.05609126948370452]</td>\n",
       "      <td>mnth_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-0.000000</td>\n",
       "      <td>[-12132277079920.521]</td>\n",
       "      <td>[0.002098490287302815]</td>\n",
       "      <td>mnth_4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>-0.041255</td>\n",
       "      <td>[-12132277079920.635]</td>\n",
       "      <td>[-0.07983496498832676]</td>\n",
       "      <td>mnth_12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.030833</td>\n",
       "      <td>[-12241521006286.586]</td>\n",
       "      <td>[0.023625814571778925]</td>\n",
       "      <td>mnth_3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.031021</td>\n",
       "      <td>[-12455807419318.012]</td>\n",
       "      <td>[0.04695212337984417]</td>\n",
       "      <td>mnth_5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>[-12560921581776.17]</td>\n",
       "      <td>[0.0351390527865387]</td>\n",
       "      <td>mnth_8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    coef_lasso                 coef_lr                coef_ridge       columns\n",
       "25    0.000000    [11474802741074.229]    [0.027486736806675682]     weekday_6\n",
       "19   -0.063867    [11133753278312.238]    [-0.04796315723174788]     weekday_0\n",
       "22    0.000664     [7536902263526.668]     [0.01691573212198294]     weekday_3\n",
       "24    0.004377     [7263909066684.871]    [0.019019838920564913]     weekday_5\n",
       "21   -0.000356     [7228285675356.838]  [-0.0010661803717622875]     weekday_2\n",
       "20   -0.030203     [7044819948074.732]    [-0.03086982808936989]     weekday_1\n",
       "23    0.000000     [6968832167683.969]    [0.014146471577980768]     weekday_4\n",
       "31    0.000127     [5449395354176.892]    [0.025077860369156046]    workingday\n",
       "30   -0.035459    [1864053055931.0798]    [-0.03063756616741456]       holiday\n",
       "32    0.515466    [0.5230867008368583]      [0.5152241992682746]            yr\n",
       "26    0.308551    [0.2829303773799931]     [0.22965247965367977]          temp\n",
       "27    0.123261   [0.13712211585161668]     [0.17918643598208345]         atemp\n",
       "29   -0.090251  [-0.10110842672596665]     [-0.0962071504909085]     windspeed\n",
       "28   -0.095121  [-0.10122042665236539]     [-0.1015905661876797]           hum\n",
       "3     0.112338   [-113429108.14347842]     [0.17006202649589203]      season_4\n",
       "0    -0.212750   [-115354305.10799249]    [-0.16915166376321578]      season_1\n",
       "1     0.017570   [-116142627.77397144]    [0.025475716902625622]      season_2\n",
       "2    -0.000000   [-117409137.08857714]   [-0.023306773177331236]      season_3\n",
       "18   -0.142207    [-617838261453.4089]    [-0.15713515483271046]  weathersit_3\n",
       "17   -0.000000   [-1789489836641.3328]    [-0.03494540718077488]  weathersit_2\n",
       "16    0.118488   [-1821870052678.0684]     [0.08761248456094617]  weathersit_1\n",
       "9     0.018321   [-11324513398298.457]     [0.04172045343050712]        mnth_6\n",
       "13    0.052847   [-11444844800810.082]     [0.03428473952949118]       mnth_10\n",
       "12    0.085700    [-11680373848486.35]     [0.10918985463794262]        mnth_9\n",
       "5    -0.011136   [-11909395091699.064]    [-0.04428011277629945]        mnth_2\n",
       "10   -0.063268    [-11909395091699.07]    [-0.03919088792124781]        mnth_7\n",
       "14   -0.030991   [-11909395091699.123]     [-0.0708794782262453]       mnth_11\n",
       "4    -0.022566   [-12021581930493.863]    [-0.05609126948370452]        mnth_1\n",
       "7    -0.000000   [-12132277079920.521]    [0.002098490287302815]        mnth_4\n",
       "15   -0.041255   [-12132277079920.635]    [-0.07983496498832676]       mnth_12\n",
       "6     0.030833   [-12241521006286.586]    [0.023625814571778925]        mnth_3\n",
       "8     0.031021   [-12455807419318.012]     [0.04695212337984417]        mnth_5\n",
       "11    0.000000    [-12560921581776.17]      [0.0351390527865387]        mnth_8"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fs = pd.DataFrame({\"columns\":list(feat_names), \"coef_lr\":list((lr.coef_.T)), \"coef_ridge\":list((ridge.coef_.T)), \"coef_lasso\":list((lasso.coef_.T))})\n",
    "fs.sort_values(by=['coef_lr'],ascending=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "LinearRegression模型发生了过拟合，RidgeCV和LassoCV模型因为加入了正则，所以效果比较好"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
